package com.xbongbong.saas.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.sys.enums.CompanyStructTypeEnum;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * 业绩目标类型
 *
 * @author hongxiao
 * @date 2019-01-26 10:48
 * @since v1.0
 */
@Getter
public enum PerformanceTitleEnum {

    // 业绩目标类型
    NAME("name","enum.performanceTitle.name.name"),
    memo("memo","enum.performanceTitle.name.memo"),
    SOURCE_ATTR("sourceAttr", "enum.performanceTitle.name.source_attr"),
    BELONG_ATTR("belongAttr", "enum.performanceTitle.name.belong_attr"),
    TIME_ATTR("timeAttr", "enum.performanceTitle.name.time_attr"),
    CREATOR_ID("creatorId", "enum.performanceTitle.name.creator_id"),
    UPDATE_TIME("updateTime", "enum.performanceTitle.name.update_time"),
    ENABLE("enable", "enum.performanceTitle.name.performance_dep"),
    OPERATO("operate", "enum.performanceTitle.name.operate");

    private String key;
    private String name;

    PerformanceTitleEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public static List<PerformanceTitleEnum> getAllEnum() {
        List<PerformanceTitleEnum> list = new ArrayList<>();
        for (PerformanceTitleEnum cache : values()) {
            list.add(cache);
        }
        return list;
    }

    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }

}
